import cn.wolfcode.wms.domain.Department;
import cn.wolfcode.wms.qo.QueryObject;
import cn.wolfcode.wms.service.IDepartmentService;
import cn.wolfcode.wms.service.IEmployeeService;
import cn.wolfcode.wms.util.PageResult;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:applicationContext.xml")
public class App {
    @Autowired
    private IDepartmentService departmentService;
    @Autowired
    private IEmployeeService employeeService;
    @Test
    public void testSave(){
        //System.out.println(departmentService.getClass());
        Department entity = new Department("九城","编号1");
        departmentService.saveOrUpdate(entity);
    }
    @Test
    public void testQuery(){
        QueryObject qo = new QueryObject();
        qo.setCurrentPage(2);
        qo.setPageSize(2);
        PageResult result = employeeService.query(qo);
        System.out.println(result);
    }
}
